New public function to find a row by its data pointer using a custom
authorFederico Mena Quintero <federico@nuclecu.unam.mx>
Mon, 3 Aug 1998 19:50:23 +0000 (19:50 +0000)
committerArturo Espinosa <unammx@src.gnome.org>
Mon, 3 Aug 1998 19:50:23 +0000 (19:50 +0000)
1998-08-03  Federico Mena Quintero  <federico@nuclecu.unam.mx>

* gtk/gtkctree.c (gtk_ctree_find_by_row_data_custom): New public
function to find a row by its data pointer using a custom
comparison function.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkctree.c
gtk/gtkctree.h

index e629a787aed030394497083573406d3423989eee..172ab4277563e9453c79fa4fe7db2b166a6503b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1998-08-03  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkctree.c (gtk_ctree_find_by_row_data_custom): New public
+       function to find a row by its data pointer using a custom
+       comparison function.
+
 Sun Aug 02 22:58:00 1998  George Lebl  <jirka@5z.com>
 
        * gtk/gtkclist.c: draw the buttons during a "draw" as well,
index e629a787aed030394497083573406d3423989eee..172ab4277563e9453c79fa4fe7db2b166a6503b1 100644 (file)
@@ -1,3 +1,9 @@
+1998-08-03  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkctree.c (gtk_ctree_find_by_row_data_custom): New public
+       function to find a row by its data pointer using a custom
+       comparison function.
+
 Sun Aug 02 22:58:00 1998  George Lebl  <jirka@5z.com>
 
        * gtk/gtkclist.c: draw the buttons during a "draw" as well,
index e629a787aed030394497083573406d3423989eee..172ab4277563e9453c79fa4fe7db2b166a6503b1 100644 (file)
@@ -1,3 +1,9 @@
+1998-08-03  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkctree.c (gtk_ctree_find_by_row_data_custom): New public
+       function to find a row by its data pointer using a custom
+       comparison function.
+
 Sun Aug 02 22:58:00 1998  George Lebl  <jirka@5z.com>
 
        * gtk/gtkclist.c: draw the buttons during a "draw" as well,
index e629a787aed030394497083573406d3423989eee..172ab4277563e9453c79fa4fe7db2b166a6503b1 100644 (file)
@@ -1,3 +1,9 @@
+1998-08-03  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkctree.c (gtk_ctree_find_by_row_data_custom): New public
+       function to find a row by its data pointer using a custom
+       comparison function.
+
 Sun Aug 02 22:58:00 1998  George Lebl  <jirka@5z.com>
 
        * gtk/gtkclist.c: draw the buttons during a "draw" as well,
index e629a787aed030394497083573406d3423989eee..172ab4277563e9453c79fa4fe7db2b166a6503b1 100644 (file)
@@ -1,3 +1,9 @@
+1998-08-03  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkctree.c (gtk_ctree_find_by_row_data_custom): New public
+       function to find a row by its data pointer using a custom
+       comparison function.
+
 Sun Aug 02 22:58:00 1998  George Lebl  <jirka@5z.com>
 
        * gtk/gtkclist.c: draw the buttons during a "draw" as well,
index e629a787aed030394497083573406d3423989eee..172ab4277563e9453c79fa4fe7db2b166a6503b1 100644 (file)
@@ -1,3 +1,9 @@
+1998-08-03  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkctree.c (gtk_ctree_find_by_row_data_custom): New public
+       function to find a row by its data pointer using a custom
+       comparison function.
+
 Sun Aug 02 22:58:00 1998  George Lebl  <jirka@5z.com>
 
        * gtk/gtkclist.c: draw the buttons during a "draw" as well,
index e629a787aed030394497083573406d3423989eee..172ab4277563e9453c79fa4fe7db2b166a6503b1 100644 (file)
@@ -1,3 +1,9 @@
+1998-08-03  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkctree.c (gtk_ctree_find_by_row_data_custom): New public
+       function to find a row by its data pointer using a custom
+       comparison function.
+
 Sun Aug 02 22:58:00 1998  George Lebl  <jirka@5z.com>
 
        * gtk/gtkclist.c: draw the buttons during a "draw" as well,
index 9cee1fd402ac095fc932830a57859e9e8cd95f8f..b36fb5e7cdd7739408458c78e6c1888293cf0ab7 100644 (file)
@@ -4077,6 +4077,27 @@ gtk_ctree_find_by_row_data (GtkCTree     *ctree,
   return NULL;
 }
 
+GtkCTreeNode *
+gtk_ctree_find_by_row_data_custom (GtkCTree     *ctree,
+                                  GtkCTreeNode *node,
+                                  gpointer      data,
+                                  GCompareFunc  func)
+{
+  GtkCTreeNode *work;
+
+  while (node)
+    {
+      if (!func (GTK_CTREE_ROW (node)->row.data, data))
+       return node;
+      if (GTK_CTREE_ROW (node)->children &&
+         (work = gtk_ctree_find_by_row_data_custom
+          (ctree, GTK_CTREE_ROW (node)->children, data, func)))
+       return work;
+      node = GTK_CTREE_ROW (node)->sibling;
+    }
+  return NULL;
+}
+
 gboolean
 gtk_ctree_is_hot_spot (GtkCTree *ctree, 
                       gint      x, 
index b48e2aad369f88a9b92056232ef0d611f5a04205..01e8d78dd1e19b416b2724aef985eed9c8239263 100644 (file)
@@ -222,6 +222,10 @@ gboolean   gtk_ctree_is_ancestor             (GtkCTree     *ctree,
 GtkCTreeNode * gtk_ctree_find_by_row_data    (GtkCTree     *ctree,
                                              GtkCTreeNode *node,
                                              gpointer      data);
+GtkCTreeNode * gtk_ctree_find_by_row_data_custom (GtkCTree     *ctree,
+                                                 GtkCTreeNode *node,
+                                                 gpointer      data,
+                                                 GCompareFunc  func);
 gboolean   gtk_ctree_is_hot_spot             (GtkCTree     *ctree,
                                              gint          x,
                                              gint          y);